script_path=$(realpath $(dirname $0))
. $script_path/../../scripts/sync.sh

echo 开始执行
ssh -p ${REMOTE_PORT} $REMOTE_HOST << EOF
cd $REMOTE_DIR/tests/torch_utils
if [ -f ~/Ascend/ascend-toolkit/set_env.sh ]; then
    source ~/Ascend/ascend-toolkit/set_env.sh
elif [ -f /usr/local/Ascend/ascend-toolkit/set_env.sh ]; then
    source /usr/local/Ascend/ascend-toolkit/set_env.sh
fi

rm build -rf
mkdir build
cd build
cmake ..
make -j
EOF


